import { getAuthListReq } from '../request/auth'
const actions = {
  // 获取权限列表
  async getAuthList(context) {
    try {
      const authListData = await getAuthListReq('list')
      context.commit('GET_AUTH_LIST', authListData)
    } catch (error) {
      return Promise.reject(error)
    }
  },
}
const mutations = {
  GET_AUTH_LIST(state, authList) {
    state.authList = authList
  },
}
const state = {
  authList: [], // 权限列表
}

export default {
  namespaced: true,
  actions,
  mutations,
  state,
}
